home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / bbs / termv4.6 / extras / source / gtlayout-source.lha / gtlayout.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-18  |  29.0 KB  |  861 lines

  1. /*
  2. **    $VER: gtlayout.h 30.3 (25.12.95)
  3. **    GadTools layout toolkit
  4. **
  5. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  6. **        Freely distributable.
  7. **
  8. **    :ts=8
  9. */
  10.  
  11. #ifndef _GTLAYOUT_H
  12. #define _GTLAYOUT_H
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(SHARED_LIB) && !defined(LINK_LIB)
  19. #define SHARED_LIB 1
  20. #endif
  21.  
  22. #ifdef _DCC
  23. #ifndef __stdargs
  24. #define __stdargs __stkargs
  25. #endif    /* __stdargs */
  26. #ifndef __asm
  27. #define __asm
  28. #endif    /* __asm */
  29. #endif    /* _DCC */
  30.  
  31. #if defined(_GTLAYOUT_GLOBAL_H) && !defined(LINK_LIB)
  32. #define _REG(x)    register __ ## x
  33. #define REG(x)    register __ ## x
  34. #define LIBENT    __saveds __asm
  35. #endif    /* _GTLAYOUT_GLOBAL_H */
  36.  
  37. #ifdef SHARED_LIB
  38. #define _REG(x)
  39. #define LIBENT
  40. #endif    /* SHARED_LIB */
  41.  
  42. #ifdef LINK_LIB
  43. #define _REG(x)
  44. #define REG(x)    register __ ## x
  45. #define LIBENT    __stdargs
  46. #endif    /* LINK_LIB */
  47.  
  48.  
  49. /*****************************************************************************/
  50.  
  51.  
  52. #ifndef EXEC_TYPES_H
  53. #include <exec/types.h>
  54. #endif
  55.  
  56. #ifndef INTUITION_INTUITION_H
  57. #include <intuition/intuition.h>
  58. #endif
  59.  
  60. #ifndef UTILITY_TAGITEM_H
  61. #include <utility/tagitem.h>
  62. #endif
  63.  
  64. #ifndef INTUITION_GADGETCLASS_H
  65. #include <intuition/gadgetclass.h>
  66. #endif
  67.  
  68. #ifndef LIBRARIES_GADTOOLS_H
  69. #include <libraries/gadtools.h>
  70. #endif
  71.  
  72.  
  73. /*****************************************************************************/
  74.  
  75.  
  76. /* Where to place a gadget label */
  77. enum
  78. {
  79.     PLACE_Left,
  80.     PLACE_Right,
  81.     PLACE_Above,
  82.     PLACE_In,
  83.     PLACE_Below
  84. };
  85.  
  86. /* How to align text lines in BOX_KIND gadgets */
  87. enum
  88. {
  89.     ALIGNTEXT_Left,
  90.     ALIGNTEXT_Centered,
  91.     ALIGNTEXT_Right,
  92.     ALIGNTEXT_Pad
  93. };
  94.  
  95. /* The button images available for TAPEDECK_KIND gadgets. */
  96. enum
  97. {
  98.     TDBT_Backward,
  99.     TDBT_Forward,
  100.     TDBT_Previous,
  101.     TDBT_Next,
  102.     TDBT_Stop,
  103.     TDBT_Pause,
  104.     TDBT_Record,
  105.     TDBT_Rewind,
  106.     TDBT_Eject,
  107.     TDBT_Play,
  108.  
  109.     TDBTLAST
  110. };
  111.  
  112. /* How to align the window opened by LT_Build() on the screen. */
  113. #define ALIGNF_Right        (1 << 0)
  114. #define ALIGNF_Left        (1 << 1)
  115. #define ALIGNF_Top        (1 << 2)
  116. #define ALIGNF_Bottom        (1 << 3)
  117. #define ALIGNF_ExtraRight    (1 << 4)
  118. #define ALIGNF_ExtraLeft    (1 << 5)
  119. #define ALIGNF_ExtraTop        (1 << 6)
  120. #define ALIGNF_ExtraBottom    (1 << 7)
  121.  
  122. /* Handy for LT_LevelWidth and LT_NewLevelWidth */
  123. typedef LONG (* __stdargs DISPFUNC)(struct Gadget *gad,LONG value);
  124.  
  125.  
  126. /*****************************************************************************/
  127.  
  128.  
  129. /* Generic tags, applicable for several object types */
  130. #define LA_Chars        TAG_USER+2
  131. #define LA_LabelPlace        TAG_USER+3
  132. #define LA_ExtraSpace        TAG_USER+4
  133. #define LA_NoKey        TAG_USER+30
  134. #define LA_HighLabel        TAG_USER+31
  135. #define LA_LabelText        TAG_USER+37
  136. #define LA_LabelID        TAG_USER+38
  137. #define LA_ID            TAG_USER+39
  138. #define LA_Type            TAG_USER+40
  139. #define LA_PageSelector        TAG_USER+79
  140. #define LA_LabelChars        TAG_USER+107
  141.  
  142. /* Storage type tags */
  143. #define LA_BYTE            TAG_USER+63
  144. #define LA_UBYTE        TAG_USER+64
  145. #define LA_WORD            TAG_USER+65
  146. #define LA_BOOL            TAG_USER+65
  147. #define LA_UWORD        TAG_USER+66
  148. #define LA_LONG            TAG_USER+67
  149. #define LA_ULONG        TAG_USER+68
  150. #define LA_STRPTR        TAG_USER+69
  151. #define LA_FRACTION        TAG_USER+68
  152.  
  153. /* for use with LT_GetAttributes() only */
  154. #define LA_Left            TAG_USER+16
  155. #define LA_Top            TAG_USER+17
  156. #define LA_Width        TAG_USER+18
  157. #define LA_Height        TAG_USER+19
  158. #define LA_LabelLeft        TAG_USER+114
  159. #define LA_LabelTop        TAG_USER+115
  160.  
  161. /* BOOPSI_KIND */
  162. #define LABO_TagCurrent        TAG_USER+119
  163. #define LABO_TagTextAttr    TAG_USER+120
  164. #define LABO_TagDrawInfo    TAG_USER+121
  165. #define LABO_TagLink        TAG_USER+129
  166. #define LABO_TagScreen        TAG_USER+132
  167. #define LABO_Link        LALV_Link
  168. #define LABO_ClassInstance    TAG_USER+122
  169. #define LABO_ClassName        TAG_USER+123
  170. #define LABO_ClassLibraryName    TAG_USER+124
  171. #define LABO_ExactWidth        TAG_USER+127
  172. #define LABO_ExactHeight    TAG_USER+128
  173. #define LABO_RelFontHeight    TAG_USER+131
  174. #define LABO_Object        TAG_USER+133
  175. #define LABO_FullWidth        TAG_USER+135
  176. #define LABO_FullHeight        TAG_USER+136
  177. #define LABO_ActivateHook    TAG_USER+141
  178.  
  179. /* BOX_KIND */
  180. #define LABX_Labels        TAG_USER+12
  181. #define LABX_Lines        TAG_USER+13
  182. #define LABX_Chars        TAG_USER+2
  183. #define LABX_Rows        TAG_USER+1
  184. #define LABX_Index        TAG_USER+14
  185. #define LABX_Text        TAG_USER+15
  186. #define LABX_AlignText        TAG_USER+27
  187. #define LABX_DrawBox        TAG_USER+11
  188. #define LABX_FirstLabel        TAG_USER+44
  189. #define LABX_LastLabel        TAG_USER+45
  190. #define LABX_ReserveSpace    TAG_USER+72
  191. #define LABX_LabelTable        TAG_USER+98
  192. #define LABX_FirstLine        TAG_USER+152
  193. #define LABX_LastLine        TAG_USER+153
  194. #define LABX_LineTable        TAG_USER+156
  195. #define LABX_Line        TAG_USER+161
  196. #define LABX_LineID        TAG_USER+162
  197.  
  198. /* BUTTON_KIND */
  199. #define LABT_ReturnKey        TAG_USER+34
  200. #define LABT_DefaultButton    TAG_USER+34
  201. #define LABT_EscKey        TAG_USER+56
  202. #define LABT_ExtraFat        TAG_USER+29
  203. #define LABT_Lines        TAG_USER+140
  204. #define LABT_FirstLine        TAG_USER+44
  205. #define LABT_LastLine        TAG_USER+45
  206. #define LABT_DefaultCorrection    TAG_USER+145
  207. #define LABT_Smaller        TAG_USER+147
  208.  
  209. /* CYCLE_KIND */
  210. #define LACY_FirstLabel        TAG_USER+44
  211. #define LACY_LastLabel        TAG_USER+45
  212. #define LACY_LabelTable        TAG_USER+98
  213. #define LACY_AutoPageID        TAG_USER+103
  214. #define LACY_TabKey        TAG_USER+118
  215.  
  216. /* FRACTION_KIND */
  217. #define LAFC_MaxChars        TAG_USER+20
  218. #define LAFC_Number        TAG_USER+21
  219. #define LAFC_LastGadget        TAG_USER+28
  220. #define LAFC_Min        TAG_USER+23
  221. #define LAFC_Max        TAG_USER+24
  222. #define LAFC_HistoryLines    TAG_USER+59
  223. #define LAFC_HistoryHook    TAG_USER+80
  224. #define LAFC_Activate        TAG_USER+148
  225.  
  226. /* FRAME_KIND */
  227. #define LAFR_InnerWidth        TAG_USER+9
  228. #define LAFR_InnerHeight    TAG_USER+10
  229. #define LAFR_DrawBox        TAG_USER+11
  230. #define LAFR_RefreshHook    TAG_USER+117
  231. #define LAFR_GenerateEvents    TAG_USER+155
  232.  
  233. /* GAUGE_KIND */
  234. #define LAGA_Percent        TAG_USER+36
  235. #define LAGA_InfoLength        TAG_USER+70
  236. #define LAGA_InfoText        TAG_USER+71
  237. #define LAGA_NoTicks        TAG_USER+143
  238. #define LAGA_Discrete        TAG_USER+144
  239. #define LAGA_Tenth        TAG_USER+144
  240.  
  241. /* INTEGER_KIND */
  242. #define LAIN_LastGadget        TAG_USER+28
  243. #define LAIN_Min        TAG_USER+23
  244. #define LAIN_Max        TAG_USER+24
  245. #define LAIN_UseIncrementers    TAG_USER+57
  246. #define LAIN_Incrementers    TAG_USER+57
  247. #define LAIN_HistoryLines    TAG_USER+59
  248. #define LAIN_HistoryHook    TAG_USER+80
  249. #define LAIN_IncrementerHook    TAG_USER+85
  250. #define LAIN_Activate        TAG_USER+148
  251. #define LAIN_ValidateHook    TAG_USER+165
  252.  
  253. /* LISTVIEW_KIND */
  254. #define LALV_ExtraLabels    TAG_USER+26
  255. #define LALV_Labels        TAG_USER+33
  256. #define LALV_CursorKey        TAG_USER+35
  257. #define LALV_Columns        TAG_USER+2
  258. #define LALV_Lines        TAG_USER+1
  259. #define LALV_Link        TAG_USER+7
  260. #define LALV_FirstLabel        TAG_USER+44
  261. #define LALV_LastLabel        TAG_USER+45
  262. #define LALV_MaxGrowX        TAG_USER+77
  263. #define LALV_MaxGrowY        TAG_USER+78
  264. #define LALV_LabelTable        TAG_USER+98
  265. #define LALV_LockSize        TAG_USER+106
  266. #define LALV_ResizeX        TAG_USER+109
  267. #define LALV_ResizeY        TAG_USER+110
  268. #define LALV_MinChars        TAG_USER+111
  269. #define LALV_MinLines        TAG_USER+112
  270. #define LALV_FlushLabelLeft    TAG_USER+113
  271. #define LALV_TextAttr        TAG_USER+138
  272. #define LALV_AutoPageID        TAG_USER+103
  273.  
  274. /* LEVEL_KIND */
  275. #define LAVL_Min        GTSL_Min
  276. #define LAVL_Max        GTSL_Max
  277. #define LAVL_Level        GTSL_Level
  278. #define LAVL_LevelFormat    GTSL_LevelFormat
  279. #define LAVL_LevelPlace        GTSL_LevelPlace
  280. #define LAVL_DispFunc        GTSL_DispFunc
  281. #define LAVL_FullCheck        LASL_FullCheck
  282.  
  283. /* MX_KIND */
  284. #define LAMX_FirstLabel        TAG_USER+44
  285. #define LAMX_LastLabel        TAG_USER+45
  286. #define LAMX_LabelTable        TAG_USER+98
  287. #define LAMX_TabKey        TAG_USER+118
  288. #define LAMX_AutoPageID        TAG_USER+103
  289.  
  290. /* PALETTE_KIND */
  291. #define LAPA_SmallPalette    TAG_USER+32
  292. #define LAPA_Lines        LA_Lines
  293. #define LAPA_UsePicker        TAG_USER+137
  294. #define LAPA_Picker        TAG_USER+137
  295.  
  296. /* PASSWORD_KIND */
  297. #define LAPW_String             GTST_String
  298. #define LAPW_LastGadget        TAG_USER+28
  299. #define LAPW_HistoryLines    TAG_USER+59
  300. #define LAPW_HistoryHook    TAG_USER+80
  301. #define LAPW_Activate        TAG_USER+148
  302. #define LAPW_MaxChars        GTST_MaxChars
  303. #define LAPW_ValidateHook    TAG_USER+165
  304.  
  305. /* POPUP_KIND */
  306. #define LAPU_FirstLabel        TAG_USER+44
  307. #define LAPU_LastLabel        TAG_USER+45
  308. #define LAPU_LabelTable        TAG_USER+98
  309. #define LAPU_AutoPageID        TAG_USER+103
  310. #define LAPU_TabKey        TAG_USER+118
  311. #define LAPU_Labels        GTCY_Labels
  312. #define LAPU_Active        GTCY_Active
  313. #define LAPU_CentreActive    TAG_USER+163
  314.  
  315. /* SLIDER_KIND */
  316. #define LASL_FullCheck        TAG_USER+22
  317.  
  318. /* SCROLLER_KIND */
  319. #define LASC_Thin        TAG_USER+62
  320.  
  321. /* STRING_KIND */
  322. #define LAST_LastGadget        TAG_USER+28
  323. #define LAST_Link        TAG_USER+7
  324. #define LAST_Picker        TAG_USER+5
  325. #define LAST_UsePicker        TAG_USER+5
  326. #define LAST_HistoryLines    TAG_USER+59
  327. #define LAST_HistoryHook    TAG_USER+80
  328. #define LAST_CursorPosition    TAG_USER+105
  329. #define LAST_Activate        TAG_USER+148
  330. #define LAST_ValidateHook    TAG_USER+165
  331.  
  332. /* TAB_KIND */
  333. #define LATB_FirstLabel        TAG_USER+44
  334. #define LATB_LastLabel        TAG_USER+45
  335. #define LATB_LabelTable        TAG_USER+98
  336. #define LATB_AutoPageID        TAG_USER+103
  337. #define LATB_TabKey        TAG_USER+118
  338. #define LATB_Labels        GTCY_Labels
  339. #define LATB_Active        GTCY_Active
  340. #define LATB_FullWidth        TAG_USER+149
  341. #define LATB_FullSize        TAG_USER+149
  342.  
  343. /* TAPEDECK_KIND */
  344. #define LATD_ButtonType        TAG_USER+86
  345. #define LATD_Toggle        TAG_USER+87
  346. #define LATD_Pressed        TAG_USER+88
  347. #define LATD_Smaller        TAG_USER+89
  348. #define LATD_Tick        TAG_USER+139
  349.  
  350. /* TEXT_KIND */
  351. #define LATX_Picker        TAG_USER+5
  352. #define LATX_UsePicker        TAG_USER+5
  353. #define LATX_LockSize        TAG_USER+106
  354.  
  355. /* VERTICAL_KIND, HORIZONTAL_KIND */
  356. #define LAGR_Spread        TAG_USER+6
  357. #define LAGR_SameSize        TAG_USER+8
  358. #define LAGR_LastAttributes    TAG_USER+46
  359. #define LAGR_ActivePage        TAG_USER+58
  360. #define LAGR_Frame        TAG_USER+104
  361. #define LAGR_IndentX        TAG_USER+130
  362. #define LAGR_IndentY        TAG_USER+134
  363. #define LAGR_NoIndent        TAG_USER+146
  364. #define LAGR_SameWidth        TAG_USER+150
  365. #define LAGR_SameHeight        TAG_USER+151
  366.  
  367. /* XBAR_KIND */
  368. #define LAXB_FullSize        TAG_USER+50
  369. #define LAXB_FullWidth        TAG_USER+50
  370.  
  371. /* Applicable for layout handle only */
  372. #define LAHN_TextAttr        TAG_USER+41
  373. #define LAHN_AutoActivate    TAG_USER+42
  374. #define LAHN_LocaleHook        TAG_USER+4
  375. #define LAHN_CloningPermitted    TAG_USER+61
  376. #define LAHN_EditHook        TAG_USER+74
  377. #define LAHN_ExactClone        TAG_USER+75
  378. #define LAHN_MenuGlyphs        TAG_USER+76
  379. #define LAHN_Parent        TAG_USER+83
  380. #define LAHN_BlockParent    TAG_USER+84
  381. #define LAHN_SimpleClone    TAG_USER+90
  382. #define LAHN_ExitFlush        TAG_USER+108
  383. #define LAHN_UserData        TAG_USER+116
  384. #define LAHN_RawKeyFilter    TAG_USER+142
  385. #define LAHN_DontPickShortcuts    TAG_USER+154
  386. #define LAHN_NoKeys        TAG_USER+154
  387. #define LAHN_PubScreen        TAG_USER+157
  388. #define LAHN_PubScreenName    TAG_USER+158
  389. #define LAHN_PubScreenFallBack    TAG_USER+159
  390.  
  391. /* Applicable for menus only. */
  392. #define LAMN_FirstLabel        LABX_FirstLabel
  393. #define LAMN_LastLabel        LABX_LastLabel
  394. #define LAMN_LabelTable        TAG_USER+98
  395. #define LAMN_TitleText        TAG_USER+17000
  396. #define LAMN_TitleID        TAG_USER+17001
  397. #define LAMN_ItemText        TAG_USER+17002
  398. #define LAMN_ItemID        TAG_USER+17003
  399. #define LAMN_SubText        TAG_USER+17004
  400. #define LAMN_SubID        TAG_USER+17005
  401. #define LAMN_KeyText        TAG_USER+17006
  402. #define LAMN_KeyID        TAG_USER+17007
  403. #define LAMN_CommandText    TAG_USER+17008
  404. #define LAMN_CommandID        TAG_USER+17009
  405. #define LAMN_MutualExclude    TAG_USER+17010
  406. #define LAMN_UserData        TAG_USER+17011
  407. #define LAMN_Disabled        TAG_USER+17012
  408. #define LAMN_CheckIt        TAG_USER+17013
  409. #define LAMN_Checked        TAG_USER+17014
  410. #define LAMN_Toggle        TAG_USER+17015
  411. #define LAMN_Code        TAG_USER+17016
  412. #define LAMN_Qualifier        TAG_USER+17017
  413. #define LAMN_Char        TAG_USER+17018
  414. #define LAMN_ID            TAG_USER+17019
  415. #define LAMN_AmigaGlyph        TAG_USER+17020
  416. #define LAMN_CheckmarkGlyph    TAG_USER+17021
  417. #define LAMN_Error        TAG_USER+17022
  418. #define LAMN_Screen        TAG_USER+17023
  419. #define LAMN_TextAttr        TAG_USER+17024
  420. #define LAMN_LayoutHandle    TAG_USER+17025
  421. #define LAMN_Handle        TAG_USER+17025
  422. #define LAMN_ExtraSpace        TAG_USER+17026
  423. #define LAMN_FullMenuNum    TAG_USER+160
  424.  
  425. /* Applicable for window only */
  426. #define LAWN_Menu        TAG_USER+25
  427. #define LAWN_UserPort        TAG_USER+47
  428. #define LAWN_Left        TAG_USER+48
  429. #define LAWN_Top        TAG_USER+49
  430. #define LAWN_Zoom        TAG_USER+50
  431. #define LAWN_MaxPen        TAG_USER+52
  432. #define LAWN_BelowMouse        TAG_USER+53
  433. #define LAWN_MoveToWindow    TAG_USER+54
  434. #define LAWN_AutoRefresh    TAG_USER+55
  435. #define LAWN_HelpHook        TAG_USER+73
  436. #define LAWN_Parent        TAG_USER+81
  437. #define LAWN_BlockParent    TAG_USER+82
  438. #define LAWN_SmartZoom        TAG_USER+91
  439. #define LAWN_Title        TAG_USER+92
  440. #define LAWN_TitleText        TAG_USER+92
  441. #define LAWN_Bounds        TAG_USER+93
  442. #define LAWN_ExtraWidth        TAG_USER+94
  443. #define LAWN_ExtraHeight    TAG_USER+95
  444. #define LAWN_IDCMP        TAG_USER+96
  445. #define LAWN_AlignWindow    TAG_USER+97
  446. #define LAWN_TitleID        TAG_USER+99
  447. #define LAWN_FlushLeft        TAG_USER+14000    /* NOTEZ-BIEN: TAG_USER+99 = WA_Dummy and can clash */
  448. #define LAWN_FlushTop        TAG_USER+14001    /*             with Intuition!                      */
  449. #define LAWN_Show        TAG_USER+14002
  450. #define LAWN_MenuTemplate    TAG_USER+14003
  451. #define LAWN_MenuTags        TAG_USER+14004
  452. #define LAWN_NoInitialRefresh    TAG_USER+164
  453.  
  454. /* Private tags; do not use, or you'll run into trouble! */
  455. #define LA_Private1        TAG_USER+100
  456. #define LA_Private2        TAG_USER+101
  457.  
  458. /* Last tag item value used */
  459. #define LAST_TAG        TAG_USER+165
  460.  
  461.  
  462. /*****************************************************************************/
  463.  
  464.  
  465. /* Identifies the absence of a link for a listview or a string gadget */
  466. #define NIL_LINK        -2
  467.  
  468.  
  469. /*****************************************************************************/
  470.  
  471.  
  472.     /* String gadget type history hook support: you will either get
  473.      * the following value passed as the message parameter to your
  474.      * hook function, or a pointer to a null-terminated string you should
  475.      * copy and create a Node from, which you should then add to the tail
  476.      * of your history list. Place a pointer to your history list in the
  477.      * Hook.h_Data entry.
  478.      */
  479.  
  480. #define HISTORYHOOK_DiscardOldest    0    /* Discard oldest entry */
  481.  
  482.  
  483. /*****************************************************************************/
  484.  
  485.  
  486.     /* Refresh hook support: you will get the following structure
  487.      * passed as the message and a pointer to the LayoutHandle as
  488.      * the object.
  489.      */
  490.  
  491. typedef struct RefreshMsg
  492. {
  493.     LONG    ID;
  494.     WORD    Left,
  495.         Top,
  496.         Width,
  497.         Height;
  498. } RefreshMsg;
  499.  
  500. /*****************************************************************************/
  501.  
  502.  
  503.     /* Incrementer hook support: you will get the current value
  504.      * passed as the object and one of the following values as
  505.      * the message. Return the number to be used.
  506.      */
  507.  
  508. enum
  509. {
  510.     INCREMENTERMSG_Decrement = -1,    /* Decrement value */
  511.     INCREMENTERMSG_Initial   =  0,    /* Initial value passed upon gadget creation */
  512.     INCREMENTERMSG_Increment =  1    /* Increment value */
  513. };
  514.  
  515.  
  516. /*****************************************************************************/
  517.  
  518.     /* Help key hook support: the hook will be called with a "struct IBox *"
  519.      * as the object and a "struct HelpMsg *". The IBox describes the object
  520.      * the mouse was positioned over, such as a button, a listview, etc.
  521.      * The "ObjectID" will indicate the ID of the object the mouse was
  522.      * positioned over. The ID will be -1 if no object was to be found.
  523.      */
  524.  
  525. typedef struct HelpMsg
  526. {
  527.     struct LayoutHandle    *Handle;    /* Window layout handle */
  528.     LONG             ObjectID;    /* ID of the object, -1 for full window */
  529. } HelpMsg;
  530.  
  531.  
  532. /*****************************************************************************/
  533.  
  534.  
  535. /* Obsolete tags, don't use in new code */
  536. #define LA_Lines        LABX_Rows
  537. #define LA_Spread        LAGR_Spread
  538. #define LA_SameSize        LAGR_SameSize
  539. #define LA_FullCheck        LASL_FullCheck
  540. #define LA_ExtraLabels        LALV_ExtraLabels
  541. #define LA_LastGadget        LAFC_LastGadget
  542. #define LA_SmallPalette        LAPA_SmallPalette
  543. #define LA_Labels        LALV_Labels
  544. #define LA_Picker        LATX_Picker
  545. #define LA_DrawBox        LAFR_DrawBox
  546. #define LA_FirstLabel        LABX_FirstLabel
  547. #define LA_LastLabel        LABX_LastLabel
  548. #define LA_LabelTable        LABX_LabelTable
  549. #define LA_Min            LAFC_Min
  550. #define LA_Max            LAFC_Max
  551. #define LA_Link            LALV_Link
  552. #define LA_Menu            LAWN_Menu
  553. #define LA_HistoryLines        LAST_HistoryLines
  554. #define LA_HistoryHook        LAST_HistoryHook
  555. #define LA_ReturnKey        LABT_ReturnKey
  556. #define LA_ExtraFat        LABT_ExtraFat
  557. #define LA_CursorKey        LALV_CursorKey
  558. #define STORE_BYTE        TAG_USER+63
  559. #define STORE_UBYTE        TAG_USER+64
  560. #define STORE_WORD        TAG_USER+65
  561. #define STORE_BOOL        TAG_USER+65
  562. #define STORE_UWORD        TAG_USER+66
  563. #define STORE_LONG        TAG_USER+67
  564. #define STORE_ULONG        TAG_USER+68
  565. #define STORE_STRPTR        TAG_USER+69
  566. #define STORE_FRACTION        TAG_USER+68
  567. #define LAHN_Font        TAG_USER+41
  568. #define LH_Font            TAG_USER+41
  569. #define LH_AutoActivate        TAG_USER+42
  570. #define LH_LocaleHook        TAG_USER+4
  571. #define LH_CloningPermitted    TAG_USER+61
  572. #define LH_EditHook        TAG_USER+74
  573. #define LH_ExactClone        TAG_USER+75
  574. #define LH_MenuGlyphs        TAG_USER+76
  575. #define LH_Parent        TAG_USER+83
  576. #define LH_BlockParent        TAG_USER+84
  577. #define LH_SimpleClone        TAG_USER+90
  578. #define LH_ExitFlush        TAG_USER+108
  579. #define LH_UserData        TAG_USER+116
  580. #define LH_RawKeyFilter        TAG_USER+142
  581.  
  582.  
  583. /* Obsolete defines, don't use in new code */
  584. #define PLACE_LEFT        PLACE_Left
  585. #define PLACE_RIGHT        PLACE_Right
  586. #define PLACE_ABOVE        PLACE_Above
  587. #define PLACE_IN        PLACE_In
  588. #define PLACE_BELOW        PLACE_Below
  589.  
  590. #define ALIGNTEXT_LEFT        ALIGNTEXT_Left
  591. #define ALIGNTEXT_CENTERED    ALIGNTEXT_Centered
  592. #define ALIGNTEXT_RIGHT        ALIGNTEXT_Right
  593. #define ALIGNTEXT_PAD        ALIGNTEXT_Pad
  594.  
  595. #define TDBT_BACKWARD        TDBT_Backward
  596. #define TDBT_FORWARD        TDBT_Forward
  597. #define TDBT_PREVIOUS        TDBT_Previous
  598. #define TDBT_NEXT        TDBT_Next
  599. #define TDBT_STOP        TDBT_Stop
  600. #define TDBT_PAUSE        TDBT_Pause
  601. #define TDBT_RECORD        TDBT_Record
  602. #define TDBT_REWIND        TDBT_Rewind
  603. #define TDBT_EJECT        TDBT_Eject
  604. #define TDBT_PLAY        TDBT_Play
  605.  
  606. #define ALIGNF_RIGHT        ALIGNF_Right
  607. #define ALIGNF_LEFT        ALIGNF_Left
  608. #define ALIGNF_TOP        ALIGNF_Top
  609. #define ALIGNF_BOTTOM        ALIGNF_Bottom
  610. #define ALIGNF_EXTRA_RIGHT    ALIGNF_ExtraRight
  611. #define ALIGNF_EXTRA_LEFT    ALIGNF_ExtraLeft
  612. #define ALIGNF_EXTRA_TOP    ALIGNF_ExtraTop
  613. #define ALIGNF_EXTRA_BOTTOM    ALIGNF_ExtraBottom
  614.  
  615. #define HISTORYHOOK_DISCARD_OLDEST    HISTORYHOOK_DiscardOldest
  616.  
  617. #define INCREMENTERMSG_DECREMENT    INCREMENTERMSG_Decrement
  618. #define INCREMENTERMSG_INITIAL        INCREMENTERMSG_Initial
  619. #define INCREMENTERMSG_INCREMENT    INCREMENTERMSG_Increment
  620.  
  621.  
  622. /*****************************************************************************/
  623.  
  624.  
  625. /* kinds of objects supported in addition to the normal GadTools kinds */
  626. #define HORIZONTAL_KIND        45
  627. #define VERTICAL_KIND        46
  628. #define END_KIND        47
  629. #define FRAME_KIND        48
  630. #define BOX_KIND        49
  631. #define FRACTION_KIND        50
  632. #define XBAR_KIND        51
  633. #define YBAR_KIND        52
  634. #define PASSWORD_KIND        53
  635. #define GAUGE_KIND        54
  636. #define TAPEDECK_KIND        55
  637. #define LEVEL_KIND        56
  638. #define BOOPSI_KIND        57
  639. #define POPUP_KIND        58
  640. #define TAB_KIND        59
  641.  
  642.  
  643. /*****************************************************************************/
  644.  
  645.  
  646. /* in support of FRACTION_KIND gadgets */
  647.  
  648. typedef ULONG            FIXED;
  649. #define FIXED_UNITY        10000
  650.  
  651. #define TO_FIXED(l,r)        (FIXED_UNITY * (l) + (r))
  652. #define FIXED_LEFT(f)        ((f) / FIXED_UNITY)
  653. #define FIXED_RIGHT(f)        ((f) % FIXED_UNITY)
  654.  
  655.  
  656. /*****************************************************************************/
  657.  
  658.  
  659. #ifndef _GTLAYOUT_GLOBAL_H
  660. typedef struct LayoutHandle
  661. {
  662.     struct Screen        *Screen;
  663.     struct DrawInfo        *DrawInfo;
  664.     struct Window        *Window;
  665.     APTR             VisualInfo;
  666.     struct Image        *AmigaGlyph,
  667.                 *CheckGlyph;
  668.     APTR             UserData;    /* Requires gtlayout.library v9 */
  669.     struct Menu        *Menu;        /* Requires gtlayout.library v13 */
  670.     /* private fields follow.... */
  671. } LayoutHandle;
  672. #endif    /* _GTLAYOUT_GLOBAL_H */
  673.  
  674.  
  675. /*****************************************************************************/
  676.  
  677.  
  678. VOID LIBENT            LT_LevelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR levelFormat,_REG(a2) DISPFUNC dispFunc,_REG(d0) LONG min,_REG(d1) LONG max,_REG(a3) LONG *maxWidth,_REG(a5) LONG *maxLen,_REG(d2) BOOL fullCheck);
  679. VOID LIBENT            LT_NewLevelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR levelFormat,_REG(a2) DISPFUNC dispFunc,_REG(d0) LONG min,_REG(d1) LONG max,_REG(a3) LONG *maxWidth,_REG(d3) LONG *maxLen,_REG(d2) BOOL fullCheck);
  680. VOID LIBENT            LT_DeleteHandle(_REG(a0) struct LayoutHandle *Handle);
  681. struct LayoutHandle * LIBENT    LT_CreateHandle(_REG(a0) struct Screen *Screen,_REG(a1) struct TextAttr *Font);
  682. struct LayoutHandle * LIBENT    LT_CreateHandleTagList(_REG(a0) struct Screen *Screen,_REG(a1) struct TagItem *TagList);
  683. BOOL LIBENT            LT_RebuildTagList(_REG(a0) struct LayoutHandle *handle,_REG(d0) BOOL clear,_REG(a1) struct TagItem *TagParams);
  684. VOID LIBENT            LT_HandleInput(_REG(a0) struct LayoutHandle *Handle,_REG(d0) ULONG MsgQualifier,_REG(a1) ULONG *MsgClass,_REG(a2) UWORD *MsgCode,_REG(a3) struct Gadget **MsgGadget);
  685. VOID LIBENT            LT_BeginRefresh(_REG(a0) struct LayoutHandle *handle);
  686. VOID LIBENT            LT_EndRefresh(_REG(a0) struct LayoutHandle *handle,_REG(d0) BOOL complete);
  687. LONG LIBENT            LT_GetAttributesA(_REG(a0) struct LayoutHandle *Handle,_REG(d0) LONG ID,_REG(a1) struct TagItem *TagList);
  688. VOID LIBENT            LT_SetAttributesA(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id,_REG(a1) struct TagItem *TagList);
  689. VOID LIBENT            LT_NewA(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct TagItem *tagList);
  690. VOID LIBENT            LT_EndGroup(_REG(a0) struct LayoutHandle *handle);
  691. struct Window * LIBENT        LT_BuildA(_REG(a0) struct LayoutHandle *Handle,_REG(a1) struct TagItem *TagParams);
  692. struct Menu * LIBENT        LT_LayoutMenusA(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct NewMenu *menuTemplate,_REG(a2) struct TagItem *TagParams);
  693. VOID LIBENT            LT_Fixed2String(_REG(d0) FIXED fixed,_REG(d1) STRPTR buffer);
  694. FIXED LIBENT            LT_String2Fixed(_REG(a0) STRPTR buffer);
  695. ULONG LIBENT            LT_FixedMult(_REG(d0) FIXED fixed,_REG(d1) ULONG factor);
  696. LONG LIBENT            LT_LabelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR label);
  697. LONG LIBENT            LT_LabelChars(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR label);
  698. VOID LIBENT            LT_LockWindow(_REG(a0) struct Window *window);
  699. VOID LIBENT            LT_UnlockWindow(_REG(a0) struct Window *window);
  700. VOID LIBENT            LT_DeleteWindowLock(_REG(a0) struct Window *window);
  701. VOID LIBENT            LT_ShowWindow(_REG(a0) struct LayoutHandle *handle,_REG(a1) BOOL activate);
  702. VOID LIBENT            LT_Activate(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id);
  703. VOID LIBENT            LT_PressButton(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id);
  704. LONG LIBENT            LT_GetCode(_REG(d0) ULONG MsgQualifier,_REG(d1) ULONG MsgClass,_REG(d2) UWORD MsgCode,_REG(a0) struct Gadget *MsgGadget);
  705. struct IntuiMessage * LIBENT    LT_GetIMsg(_REG(a0) struct LayoutHandle *Handle);
  706. VOID LIBENT            LT_ReplyIMsg(_REG(a0) struct IntuiMessage *Msg);
  707. VOID LIBENT            LT_UpdateStrings(_REG(a0) struct LayoutHandle *Handle);
  708. VOID LIBENT            LT_DisposeMenu(_REG(a0) struct Menu *Menu);
  709. struct Menu * LIBENT        LT_NewMenuTemplate(_REG(a0) struct Screen *Screen,_REG(a1) struct TextAttr *TextAttr,_REG(a2) struct Image *AmigaGlyph,_REG(a3) struct Image *CheckGlyph,_REG(d0) LONG *Error,_REG(d1) struct NewMenu *MenuTemplate);
  710. struct Menu * LIBENT        LT_NewMenuTagList(_REG(a0) struct TagItem *TagList);
  711. VOID LIBENT            LT_MenuControlTagList(_REG(a0) struct Window *Window,_REG(a1) struct Menu *IntuitionMenu,_REG(a2) struct TagItem *Tags);
  712. struct MenuItem * LIBENT    LT_GetMenuItem(_REG(a0) struct Menu *Menu,_REG(d0) ULONG ID);
  713. struct MenuItem * LIBENT    LT_FindMenuCommand(_REG(a0) struct Menu *Menu,_REG(d0) UWORD MsgCode,_REG(d1) UWORD MsgQualifier,_REG(a1) struct Gadget *MsgGadget);
  714. VOID LIBENT            LT_Refresh(_REG(a0) struct LayoutHandle *Handle);
  715.  
  716.  
  717. /*****************************************************************************/
  718.  
  719.  
  720. /* For use as link library */
  721.  
  722. BOOL LIBENT            LT_Init(VOID);
  723. VOID LIBENT            LT_Exit(VOID);
  724.  
  725. /* Available for library-internal use and as link library */
  726.  
  727. BOOL __stdargs            LT_RebuildTags(struct LayoutHandle *handle,BOOL clear,...);
  728. struct LayoutHandle * __stdargs    LT_CreateHandleTags(struct Screen *Screen,...);
  729. LONG __stdargs            LT_GetAttributes(struct LayoutHandle *Handle,LONG ID,...);
  730. VOID __stdargs            LT_SetAttributes(struct LayoutHandle *handle,LONG id,...);
  731. VOID __stdargs            LT_AddL(struct LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...);
  732. VOID __stdargs            LT_Add(struct LayoutHandle *Handle,LONG Type,STRPTR Label,LONG ID,...);
  733. VOID __stdargs            LT_New(struct LayoutHandle *handle,...);
  734. struct Window * __stdargs    LT_Build(struct LayoutHandle *Handle,...);
  735. struct Window * __stdargs    LT_Layout(struct LayoutHandle *handle, STRPTR title,struct IBox *bounds,LONG extraWidth, LONG extraHeight,ULONG IDCMP, LONG align, ...);
  736. struct Menu * __stdargs        LT_LayoutMenus(struct LayoutHandle *handle,struct NewMenu *menuTemplate,...);
  737.  
  738. struct Menu * __stdargs        LT_NewMenuTags(Tag FirstTag,...);
  739. VOID __stdargs            LT_MenuControlTags(struct Window *Window,struct Menu *Menu,...);
  740.  
  741.  
  742. /*****************************************************************************/
  743.  
  744.  
  745. /* Useful macros */
  746.  
  747. #define LT_GetString(Handle,Code)    ((STRPTR)LT_GetAttributesA((Handle),(Code),NULL))
  748.  
  749. #define LAMN_Menu_UserData(m)        (*(APTR *)(((struct Menu *)(m)) + 1))
  750. #define LAMN_Menu_ID(m)            (((ULONG *)(((struct Menu *)(m)) + 1))[1])
  751.  
  752. #define LAMN_Item_UserData(m)        (*(APTR *)(((struct MenuItem *)(m)) + 1))
  753. #define LAMN_Item_ID(m)            (((ULONG *)(((struct MenuItem *)(m)) + 1))[1])
  754.  
  755.  
  756. /*****************************************************************************/
  757.  
  758.  
  759. /* Obsolete routines, do not use in new code. */
  760.  
  761. BOOL LIBENT                LT_Rebuild(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct IBox *bounds,_REG(a2) LONG extraWidth,_REG(d0) LONG extraHeight,_REG(d1) BOOL clear);
  762. struct Window * LIBENT            LT_LayoutA(_REG(a0) struct LayoutHandle *handle, _REG(a1) STRPTR title,_REG(a2) struct IBox *bounds,_REG(d0) LONG extraWidth, _REG(d1) LONG extraHeight,_REG(d2) ULONG IDCMP, _REG(d3) LONG align, _REG(a3) struct TagItem *TagParams);
  763. VOID LIBENT                LT_AddA(_REG(a0) struct LayoutHandle *Handle,_REG(d0) LONG Type,_REG(d1) STRPTR Label,_REG(d2) LONG ID,_REG(a1) struct TagItem *TagList);
  764.  
  765. #define LT_GetDrawInfo(Handle)        ((Handle) ? ((Handle) -> DrawInfo)    : NULL)
  766. #define LT_GetVisualInfo(Handle)    ((Handle) ? ((Handle) -> VisualInfo)    : NULL)
  767. #define LT_GetScreen(Handle)        ((Handle) ? ((Handle) -> Screen)    : NULL)
  768. #define LT_SetAutoActivate(Handle,Mode)    LT_SetAttributes(Handle,0,LH_AutoActivate,Mode,TAG_DONE)
  769.  
  770.  
  771. /*****************************************************************************/
  772.  
  773.  
  774. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(NO_PRAGMAS) && !defined(LINK_LIB)
  775. #pragma libcall GTLayoutBase LT_LevelWidth 1e 2DB10A9808
  776. #pragma libcall GTLayoutBase LT_DeleteHandle 24 801
  777. #pragma libcall GTLayoutBase LT_CreateHandle 2a 9802
  778. #pragma libcall GTLayoutBase LT_CreateHandleTagList 30 9802
  779. #ifdef __SASC_60
  780. #pragma tagcall GTLayoutBase LT_CreateHandleTags 30 9802
  781. #endif
  782. #pragma libcall GTLayoutBase LT_Rebuild 36 10A9805
  783. #pragma libcall GTLayoutBase LT_HandleInput 3c BA90805
  784. #pragma libcall GTLayoutBase LT_BeginRefresh 42 801
  785. #pragma libcall GTLayoutBase LT_EndRefresh 48 0802
  786. #pragma libcall GTLayoutBase LT_GetAttributesA 4e 90803
  787. #ifdef __SASC_60
  788. #pragma tagcall GTLayoutBase LT_GetAttributes 4e 90803
  789. #endif
  790. #pragma libcall GTLayoutBase LT_SetAttributesA 54 90803
  791. #ifdef __SASC_60
  792. #pragma tagcall GTLayoutBase LT_SetAttributes 54 90803
  793. #endif
  794. #pragma libcall GTLayoutBase LT_AddA 5a 9210805
  795. #ifdef __SASC_60
  796. #pragma tagcall GTLayoutBase LT_Add 5a 9210805
  797. #endif
  798. #pragma libcall GTLayoutBase LT_NewA 60 9802
  799. #ifdef __SASC_60
  800. #pragma tagcall GTLayoutBase LT_New 60 9802
  801. #endif
  802. #pragma libcall GTLayoutBase LT_EndGroup 66 801
  803. #pragma libcall GTLayoutBase LT_LayoutA 6c B3210A9808
  804. #ifdef __SASC_60
  805. #pragma tagcall GTLayoutBase LT_Layout 6c B3210A9808
  806. #endif
  807. #pragma libcall GTLayoutBase LT_LayoutMenusA 72 A9803
  808. #ifdef __SASC_60
  809. #pragma tagcall GTLayoutBase LT_LayoutMenus 72 A9803
  810. #endif
  811. #pragma libcall GTLayoutBase LT_Fixed2String 78 1002
  812. #pragma libcall GTLayoutBase LT_String2Fixed 7e 801
  813. #pragma libcall GTLayoutBase LT_FixedMult 84 1002
  814. #pragma libcall GTLayoutBase LT_LabelWidth 8a 9802
  815. #pragma libcall GTLayoutBase LT_LabelChars 90 9802
  816. #pragma libcall GTLayoutBase LT_LockWindow 96 801
  817. #pragma libcall GTLayoutBase LT_UnlockWindow 9c 801
  818. #pragma libcall GTLayoutBase LT_DeleteWindowLock a2 801
  819. #pragma libcall GTLayoutBase LT_ShowWindow a8 9802
  820. #pragma libcall GTLayoutBase LT_Activate ae 0802
  821. #pragma libcall GTLayoutBase LT_PressButton b4 0802
  822. #pragma libcall GTLayoutBase LT_GetCode ba 821004
  823. /*--- Added in v1.78 --------------------------------------------------*/
  824. #pragma libcall GTLayoutBase LT_GetIMsg c0 801
  825. #pragma libcall GTLayoutBase LT_ReplyIMsg c6 801
  826. /*--- Added in v3.0 ---------------------------------------------------*/
  827. #pragma libcall GTLayoutBase LT_BuildA cc 9802
  828. #ifdef __SASC_60
  829. #pragma tagcall GTLayoutBase LT_Build cc 9802
  830. #endif
  831. #pragma libcall GTLayoutBase LT_RebuildTagList d2 90803
  832. #ifdef __SASC_60
  833. #pragma tagcall GTLayoutBase LT_RebuildTags d2 90803
  834. #endif
  835. /*--- Added in v9.0 ---------------------------------------------------*/
  836. #pragma libcall GTLayoutBase LT_UpdateStrings d8 801
  837. /*--- Added in v11.0 ---------------------------------------------------*/
  838. #pragma libcall GTLayoutBase LT_DisposeMenu de 801
  839. #pragma libcall GTLayoutBase LT_NewMenuTemplate e4 10BA9806
  840. #pragma libcall GTLayoutBase LT_NewMenuTagList ea 801
  841. #ifdef __SASC_60
  842. #pragma tagcall GTLayoutBase LT_NewMenuTags ea 801
  843. #endif
  844. #pragma libcall GTLayoutBase LT_MenuControlTagList f0 A9803
  845. #ifdef __SASC_60
  846. #pragma tagcall GTLayoutBase LT_MenuControlTags f0 A9803
  847. #endif
  848. #pragma libcall GTLayoutBase LT_GetMenuItem f6 0802
  849. #pragma libcall GTLayoutBase LT_FindMenuCommand fc 910804
  850. /*--- Added in v14.0 ---------------------------------------------------*/
  851. #pragma libcall GTLayoutBase LT_NewLevelWidth 102 23B10A9808
  852. /*--- Added in v31.0 ---------------------------------------------------*/
  853. #pragma libcall GTLayoutBase LT_Refresh 108 801
  854. #endif    /* !_GTLAYOUT_GLOBAL_H && !NO_PRAGMAS */
  855.  
  856.  
  857. /*****************************************************************************/
  858.  
  859.  
  860. #endif    /* _GTLAYOUT_H */
  861.